package com.zhoug.common.content;

import android.accounts.AccountManager;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.content.Context;
import android.hardware.SensorManager;
import android.location.LocationManager;
import android.os.Build;
import android.os.PowerManager;
import android.os.VibratorManager;
import android.os.storage.StorageManager;
import android.view.LayoutInflater;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;

import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat;

/**
 * 系统Service创建工具
 *
 * @Author: zhoug
 * @Date: 2024-09-05
 * @Description:
 */
public class SystemServiceUtils {

    /**
     * 通知管理器
     *
     * @param context
     * @return
     */
    public static NotificationManager getNotificationManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,NotificationManager.class);
    }

    /**
     * 无障碍管理器
     *
     * @param context
     * @return
     */
    public static AccessibilityManager getAccessibilityManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,AccessibilityManager.class);
    }

    /**
     * 电源管理器
     *
     * @param context
     * @return
     */
    public static PowerManager getPowerManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,PowerManager.class);
    }

    /**
     * 窗口管理器
     *
     * @param context
     * @return
     */
    public static WindowManager getWindowManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,WindowManager.class);

    }

    /**
     * 布局管理器
     *
     * @param context
     * @return
     */
    public static LayoutInflater getLayoutInflater(@NonNull Context context) {
        return ContextCompat.getSystemService(context,LayoutInflater.class);

    }

    /**
     * 账号管理器
     *
     * @param context
     * @return
     */
    public static AccountManager getAccountManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,AccountManager.class);

    }

    /**
     * ActivityManager管理器
     *
     * @param context
     * @return
     */
    public static ActivityManager getActivityManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,ActivityManager.class);

    }

    /**
     * 闹钟管理器
     *
     * @param context
     * @return
     */
    public static AlarmManager getAlarmManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,AlarmManager.class);

    }

    /**
     * 位置管理器
     *
     * @param context
     * @return
     */
    public static LocationManager getLocationManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,LocationManager.class);

    }

    /**
     * 管理器
     *
     * @param context
     * @return
     */
    public static SensorManager getSensorManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,SensorManager.class);

    }

    /**
     * 管理器
     *
     * @param context
     * @return
     */
    public static StorageManager getStorageManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,StorageManager.class);

    }

    /**
     * 振动器管理器
     *
     * @param context
     * @return
     */
    @RequiresApi(api = Build.VERSION_CODES.S)
    public static VibratorManager getVibratorManager(@NonNull Context context) {
        return ContextCompat.getSystemService(context,VibratorManager.class);
    }




}
